<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
<script type="text/javascript">
	let arr = [1,3,4,4,1,11,33,3,11]
	
	let newArr = []
	newArr[0] = arr[0]
	for(let i = 0; i <arr.length; i++){
		let flag = false
		for(let j = 0; j < newArr.length; j++){
			if(arr[i] === newArr[j]){
				//跟newarr里的每一项比较
				flag = true
				break
			}
		}
		//如果跟newArr比较完还是false说明newarr里没用重复的
		if(!flag){
			newArr.push(arr[i])
		}
	}
	console.log(newArr)
</script>
</body>
</html>